package com.example.rabbit.constant;

import org.springframework.amqp.core.DirectExchange;
import org.springframework.amqp.core.FanoutExchange;
import org.springframework.amqp.core.TopicExchange;

/**
 * @Author ifredomvip@gmail.com
 * @Date 2022/8/10 14:40
 * @Version 1.0.0
 * @Description
 **/
public enum RabbitExchangeTypeEnum {
    /**
     * 死信转发方式延迟队列
     */
    TTL_QUEUE(1, DirectExchange.class),

    /**
     * 正常队列
     */
    NORMAL_QUEUE(2, DirectExchange.class),

    /**
     * 广播队列
     */
    FANOUT_QUEUE(3, FanoutExchange.class),

    /**
     * topic队列
     */
    TOPIC_QUEUE(4, TopicExchange.class),

    /**
     * 死信队列
     */
    DEAD_LETTER_QUEUE(5, TopicExchange.class);


    /**
     * 队列routeKey
     */
    private int index;

    /**
     * 交换机class
     */
    private Class exchangeClazz;


    RabbitExchangeTypeEnum(int index, Class exchangeClazz) {
        this.index = index;
        this.exchangeClazz = exchangeClazz;
    }

    public int getIndex() {
        return index;
    }

    public Class getExchangeClazz() {
        return exchangeClazz;
    }
}
